import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: ()=>import('../index'),
    children:[
      {
        path:'/index/aboutUs',
        component:()=>import('../views/aboutUs')
      },
      {
        path:'/index/fistPage',
        component:()=>import('../views/fistPage')
      },
      {
        path: '/index/productShow',
        component:()=>import('../views/productShow')
      },
      {
        path:'/index/seller',
        component:()=>import('../views/seller')
      },
      {
        path:'/index/paper',
        component:()=>import('../views/paper')

      },
      {
        path:'/index/callUs',
        component:()=>import('../views/callus')
      },
      {
        path:'/product/detail',
        component:()=>import('../views/product/productDetails'),
        props:true   //组件之间的值传递以props来进行
      }

    ]
  },
  {
    path:'/login',
    component:()=>import('../views/login')
  }



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
